import server from '../serve/http.js'
// 获取登录信息
const getLogin = async function (params) {
    var data = await server.post(
        '/api/users/login',
        params
    )
    return Promise.resolve(data)
}
// 首页轮播图数据
const getSwiper = async function () {
    var data = await server.post('/api/resources/carousel')
    return Promise.resolve(data)
}
// 首页热门商品数据
const getHot = async function () {
    var data = await server.post('/api/product/getHotProduct', {
        "categoryName": ["电视机", "空调", "洗衣机", "保护套", "保护膜", "充电器", "充电宝"]
    })
    return Promise.resolve(data)
}
// 所有商品  分类数据
const getList = async function () {
    var data = await server.post('/api/product/getCategory')
    return Promise.resolve(data)
}
// 所有商品数据
const getShop = async function () {
    var data = await server.post('/api/product/getAllProduct')
    return Promise.resolve(data)
}
export {
    getLogin,
    getSwiper,
    getHot,
    getList,
    getShop
}